class Response {
    // 构造函数
    constructor() {
        this.code = 200;
        this.msg = null;
        this.data = null;
    }

    // 成功返回
    ok(msg, data) {
        this.code = 200;
        this.msg = msg;
        this.data = data;
        return this;
    }

    // 失败返回
    fail(code, msg) {
        this.code = code;
        this.msg = msg;
        return this;
    }
}

module.exports = Response;